package dormatory;

import java.util.ArrayList;
import java.util.List;


public class Dormitory {

	private List<Room> roomList = new ArrayList<Room>();
	public String name;
	
	// constructor for Dormitory
	public Dormitory(String name) {
		this.name = name;
		} 
	
	public List<Room> getRoomList() {
		return roomList;
	};
	
	
	
	public int bedsAvailable() {
		int totalBedsAvailable=0;
		for (Room room : roomList) {
			totalBedsAvailable = totalBedsAvailable + room.bedsAvailable();
		}
		return totalBedsAvailable;
	}
	
	public int totalGuest(){
		int totalGuests=0;
		for (Room room : roomList) {		
			totalGuests = totalGuests + room.totalGuests();
		}
		return totalGuests;
	}
	
	/*
	public int percentBedsAvailable() {
		return ()
		
		REAL WORLD MATH:
		
		total capacity - total guests = X
		X / total capacity = percent of beds available
	}
	*/

	// adds a room to internal list

	public void addRoom(Room room) {
		roomList.add(room);
	}

	public String getName() {
		return name;
	}	
	
	
	
}
